//导入express
const express = require("express");
//实例化
const app = express();
//导入路由
const routers = require("./routes")

app.use(express.json());  
//使用urlencoded中间件
//可以快速接收post传递过来的参数，post传递的参数会添加在body属性中
app.use(express.urlencoded({extended:false}));
//注册
app.use("/api",routers)


//监听端口
app.listen(8080,()=>{
    console.log("8080端口已启动")
})